from fastapi import APIRouter
from src.huey_init.storages import Storage
from src.gen_file.datamodel import GenModel
from src.gen_file.tasks import run_gen_task

router = APIRouter(
    prefix="/generate",
    tags=["generate"],
    responses={404: {"description": "Not found"}}
)
# 生成任务入口
@router.post("/generate")
async def aigenfile(gen_model: GenModel):
    res = run_gen_task(gen_model)
    return {"status": "success", "aitask_id": res.id}
